﻿using System;
using System.Collections.Generic;
using System.Text;

namespace X3dTest
{
    namespace Environment           //解决类重名问题
    {
        public class ProtoInstance : X3DObject
        {
            private string Name;
            /// <summary>
            /// 实体名称
            /// </summary>
            public string name
            {
                get { return Name; }
                set { Name = value; }
            }

            private string Color;
            /// <summary>
            /// 主体颜色
            /// </summary>
            public string color
            {
                get { return Color; }
                set { Color = value; }
            }
            private string Range;
            /// <summary>
            /// 活动范围
            /// </summary>
            public string range
            {
                get { return Range; }
                set { Range = value; }
            }
            private string Gravity;
            /// <summary>
            /// 重力加速度
            /// </summary>
            public string gravity
            {
                get { return Gravity; }
                set { Gravity = value; }
            }
            private string Wind;
            /// <summary>
            /// 风速
            /// </summary>
            public string wind
            {
                get { return Wind; }
                set { Wind = value; }
            }
            public ProtoInstance(string name)
            {
                this.name = name;
            }
            /// <summary>
            /// 创建环境
            /// </summary>
            /// <param name="name">节点名称</param>
            /// <param name="color">主体颜色</param>
            /// <param name="range">活动范围</param>
            /// <param name="gravity">重力加速度</param>
            /// <param name="wind">风速</param>
            /// 必须以addChildren（fieldValue)的形式，否则拿不到初始值
            public ProtoInstance(string name,string color,string range,string life,string gravity,string wind)
            {
                this.name = name;
                this.addChildren(new fieldValue("color", color));
                this.addChildren(new fieldValue("range", range));
                this.addChildren(new fieldValue("life", life));
                this.addChildren(new fieldValue("gravity", gravity));
                this.addChildren(new fieldValue("wind", wind));
                //this.color = color;
                //this.range = range;
                //this.gravity = gravity;
                //this.wind = wind;
            }

            private string Life;

            public string life
            {
                get { return Life; }
                set { Life = value; }
            }
        }
    }
    public class ProtoInstance : X3DObject, INode
    {
        public string Name;

        public string name
        {
            get { return Name; }
            set { Name = value; }
        }
        private string Position;
        /// <summary>
        /// 位置
        /// </summary>
        public string position
        {
            get { return Position; }
            set { Position = value; }
        }

        private string DiffuseColor;
        private string AmissiveColor;
        private string SpecularColor;
        private string Shininess;
        private string AmbientIntensity;
        private string Transparency;

        /// <summary>
        /// 环境光色彩强度 default=0.2
        /// </summary>
        public string ambientIntensity
        {
            get { return AmbientIntensity; }
            set { AmbientIntensity = value; }
        }
        /// <summary>
        /// 色彩的漫反射 default='0.8 0.8 0.8'
        /// </summary>
        public string diffuseColor
        {
            get { return DiffuseColor; }
            set { DiffuseColor = value; }
        }
        /// <summary>
        /// 辐射光色彩
        /// </summary>
        public string emissiveColor
        {
            get { return AmissiveColor; }
            set { AmissiveColor = value; }
        }
        /// <summary>
        /// 反射光色彩
        /// </summary>
        public string specularColor
        {
            get { return SpecularColor; }
            set { SpecularColor = value; }
        }
        /// <summary>
        /// 光亮程度 default='0.2'
        /// </summary>
        public string shininess
        {
            get { return Shininess; }
            set { Shininess = value; }
        }
        
        /// <summary>
        /// 透明度 default='0.15'
        /// </summary>
        public string transparency
        {
            get { return Transparency; }
            set { Transparency = value; }
        }

        private string Age;
        /// <summary>
        /// 粒子寿命
        /// </summary>
        public string age
        {
            get { return Age; }
            set { Age = value; }
        }

        /// <summary>
        /// 各个方向的初始速度
        /// </summary>
        private string Velocity;

        public string velocity
        {
            get { return Velocity; }
            set { Velocity = value; }
        }
        /// <summary>
        /// 只要创建实例就可以，不必要初始化，将在Script中初始化
        /// </summary>
        /// <param name="name"></param>
        public ProtoInstance(string name)
        {
            this.name = name;
        }
    }
}
